/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.isn.historiaclinica.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author pool
 */
@Embeddable
public class ProvinciaPK implements Serializable {
  
	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @Column(name = "Cod_Prov", columnDefinition="CHAR(5) unsigned")
    private String codProv;
    @Basic(optional = false)
    @Column(name = "Cod_Depa", columnDefinition="CHAR(5) unsigned")
    private String codDepa;

    public ProvinciaPK() {
    }

    public ProvinciaPK(String codProv, String codDepa) {
        this.codProv = codProv;
        this.codDepa = codDepa;
    }

    public String getCodProv() {
        return codProv;
    }

    public void setCodProv(String codProv) {
        this.codProv = codProv;
    }

    public String getCodDepa() {
        return codDepa;
    }

    public void setCodDepa(String codDepa) {
        this.codDepa = codDepa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codProv != null ? codProv.hashCode() : 0);
        hash += (codDepa != null ? codDepa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProvinciaPK)) {
            return false;
        }
        ProvinciaPK other = (ProvinciaPK) object;
        if ((this.codProv == null && other.codProv != null) || (this.codProv != null && !this.codProv.equals(other.codProv))) {
            return false;
        }
        if ((this.codDepa == null && other.codDepa != null) || (this.codDepa != null && !this.codDepa.equals(other.codDepa))) {
            return false;
        }
        return true;
    }

}
